package com.xiaomi.entity;

import java.util.List;

/**
 * @ClassName PageBean
 * @Author xiao宋
 * @Date 21:23  2022/9/14
 * @Version 1.0
 * @Description TODO 分页，暂时搁置，先弄别的，暂时先这样将就先用着
 */
public class PageBean<T>{
    private long totalCount;//总条数
    private List<T>data;//页面要展示的数据
    private int pageNum;//当前页面
    private int startPage;//要展示的第一个页码
    private int endPage;//要展示的最后一个页码
    private int totaoPage;//总页数
    private int pageSize;//每页条数

    public PageBean() {
    }

    public PageBean(long totalCount, List<T> data, int pageNum, int startPage, int endPage, int totaoPage, int pageSize) {
        this.totalCount = totalCount;
        this.data = data;
        this.pageNum = pageNum;
        this.startPage = startPage;
        this.endPage = endPage;
        this.totaoPage = totaoPage;
        this.pageSize = pageSize;
    }

    public long getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(long totalCount) {
        this.totalCount = totalCount;
    }

    public List<T> getData() {
        return data;
    }

    public void setData(List<T> data) {
        this.data = data;
    }

    public int getPageNum() {
        return pageNum;
    }

    public void setPageNum(int pageNum) {
        this.pageNum = pageNum;
    }

    public int getStartPage() {
        return startPage;
    }

    public void setStartPage(int startPage) {
        this.startPage = startPage;
    }

    public int getEndPage() {
        int tp=(int) Math.ceil(totalCount*1.0/pageSize);
        return tp;
    }

    public void setEndPage(int endPage) {
        this.endPage = endPage;
    }

    public int getTotaoPage() {
        int tp=(int) Math.ceil(totalCount*1.0/pageSize);
        return tp;
    }

    public void setTotaoPage(int totaoPage) {
        this.totaoPage = totaoPage;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }
}
